package com.rc.saas.tenant.service.operator;

import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseSearch;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.operator.TenantOperatorMapper;
import com.rc.saas.tenant.model.acct.AcctWithdrawApply;
import com.rc.saas.tenant.model.acct.TenantOperatorAcctSetting;
import com.rc.saas.tenant.model.tenant.*;
import com.rc.saas.tenant.model.operator.TenantOperator;
import com.rc.saas.tenant.model.operator.TenantOperatorExample;
import com.rc.saas.tenant.search.acct.AcctTenantOperatorElecStationSearch;
import com.rc.saas.tenant.search.operator.OperatorSearch;
import com.rc.saas.tenant.vo.operator.OperatorElecStationVo;

import java.util.List;

/**
 * Created by sven on 2019/9/18
 */
public interface TenantOperatorService extends BaseService<String, TenantOperator, TenantOperatorExample, TenantOperatorMapper> {
    /**
     * 保存分销商信息和登陆帐户信息
     *
     * @param operator
     */
    void insertOperatorAndUser(TenantOperator operator, TenantUser user);

    /**
     * 修改运营商和登录帐户状态
     *
     * @param tenantOperator
     * @param tenantUser
     */
    void updateOperatorAndUserStatus(TenantOperator tenantOperator, TenantUser tenantUser);

    /**
     * 修改运营商和登录帐户密码
     *
     * @param tenantOperator
     * @param tenantUser
     * @return
     */
    String updateOperatorAndUserPassword(TenantOperator tenantOperator, TenantUser tenantUser, String password);

    /**
     * 通过loginName进行查询
     *
     * @param loginName
     */
    TenantOperator selectByLoginName(String loginName);

    /**
     * 判断此登录帐号是否存在
     *
     * @param loginName
     * @return
     */
    TenantOperator checkLoginNameExist(String loginName);

    /**
     * 判断此手机号是否存在
     *
     * @param phone
     * @return
     */
    TenantOperator checkPhoneExist(String phone);

    /**
     * 判断此组织机构代码是否存在
     *
     * @param operatorCode
     * @return
     */
    TenantOperator checkOperatorCodeExist(String operatorCode);

    PageInfo<TenantOperator> listPageOperator(TenantOperatorExample example, int pageNum, int pageSize);

    List<TenantOperator> listOperatorByTenantCode(String tenantCode);

    PageInfo<OperatorElecStationVo> listPageOperatorElecStation(BaseSearch baseSearch);

    void updatebatchType(List<Long> operatorStationIdList, String govtHlhtType,String tenantOperatorCode);

    List<TenantOperator> listExportTenantOperator(OperatorSearch search);

    PageInfo<TenantOperator> listPageTenantOperator(OperatorSearch search);

    PageInfo<OperatorElecStationVo> listPageAcctTenantOperatorElecStation(AcctTenantOperatorElecStationSearch acctTenantOperatorElecStationSearch);

    List<OperatorElecStationVo> exportAcctTenantOperatorElecStation(AcctTenantOperatorElecStationSearch acctTenantOperatorElecStationSearch);

    /**
     * 提现到银行卡接口（暂定）
     * @param tenantOperator
     * @param acctWithdrawApply
     * @param acctSetting
     * @return
     */
    TResponse bankTransPayWallet(TenantOperator tenantOperator, AcctWithdrawApply acctWithdrawApply, TenantOperatorAcctSetting acctSetting);
}